home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm2 / amislt14.lha / AmiSlate / SlateRexx / explode.rexx < prev    next >
OS/2 REXX Batch file  |  1996-01-27  |  888b  |  47 lines

  1. /* An Arexx script for use with AmiSlate:  
  2.  
  3.      Makes a explosion-type thing on the screen.
  4.    
  5. */
  6. parse arg CommandPort ActiveString
  7.  
  8. address (CommandPort)
  9.  
  10. if (length(CommandPort) == 0) then do
  11.     say ""
  12.     say "Usage:  rx explode.rexx <REXXPORTNAME>"
  13.     say "        (REXXPORTNAME is usually AMISLATE)"
  14.     say ""
  15.     say "Or run from the Rexx menu within AmiSlate."
  16.     say ""
  17.     exit 0
  18.     end
  19.  
  20.  
  21. options results
  22.  
  23. GetWindowAttrs stem win.
  24.  
  25. MaxX = (win.width - 59)
  26. MaxY = (win.height - 54)
  27.  
  28. HalfMaxX = trunc(MaxX/2)
  29. HalfMaxY = trunc(MaxY/2)
  30.  
  31. /* Calculate center of drawing area */
  32. mx = trunc((win.width-58)/2)
  33. my = trunc((win.height-53)/2)
  34.  
  35. NumberOfLines = 300
  36.  
  37. do while (NumberOfLines > 0)
  38.     x = mx + rand(MaxX) - HalfMaxX
  39.     y = my + rand(MaxY) - HalfMaxY
  40.     
  41.     line mx my x y
  42.     setfcolor rand(15) rand(15) rand(15) notbackground
  43.     NumberOfLines = NumberOfLines - 1
  44. end
  45.  
  46. rand:
  47.     return trunc(Random()*arg(1)/1000)